package com.example.azheng.rxjavamvpdemo.ui.fragment;

import android.content.Intent;
import android.text.TextUtils;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.example.azheng.rxjavamvpdemo.R;
import com.example.azheng.rxjavamvpdemo.base.BaseFragment;
import com.example.azheng.rxjavamvpdemo.bean.BaseObjectBean;
import com.example.azheng.rxjavamvpdemo.bean.userInfo.UserInfo;
import com.example.azheng.rxjavamvpdemo.ui.acitivity.DepositAndWithdrawalRecordActivity;
import com.example.azheng.rxjavamvpdemo.ui.acitivity.RulesOfPlayActivity;
import com.example.azheng.rxjavamvpdemo.util.UserInfoUtils;

import butterknife.BindView;
import butterknife.OnClick;

/**
 * Time:2020/5/19
 * Author:ypf
 * Description:
 */
public class MineFragment extends BaseFragment {

    @BindView(R.id.imageView13)
    ImageView imageView13;
    @BindView(R.id.imageView9)
    ImageView imageView9;
    @BindView(R.id.ivAvatar)
    ImageView ivAvatar;
    @BindView(R.id.tvNickName)
    TextView tvNickName;
    @BindView(R.id.view18)
    View view18;
    @BindView(R.id.tvTotalAssets)
    TextView tvTotalAssets;
    @BindView(R.id.textView55)
    TextView textView55;
    @BindView(R.id.tvCentralWallet)
    TextView tvCentralWallet;
    @BindView(R.id.imageView16)
    ImageView imageView16;
    @BindView(R.id.imageView22)
    ImageView imageView22;
    @BindView(R.id.imageView15)
    ImageView imageView15;
    @BindView(R.id.imageView17)
    ImageView imageView17;
    @BindView(R.id.imageView23)
    ImageView imageView23;
    @BindView(R.id.imageView27)
    ImageView imageView27;
    @BindView(R.id.imageView24)
    ImageView imageView24;
    @BindView(R.id.imageView28)
    ImageView imageView28;
    @BindView(R.id.imageView25)
    ImageView imageView25;
    @BindView(R.id.imageView29)
    ImageView imageView29;
    @BindView(R.id.imageView26)
    ImageView imageView26;
    @BindView(R.id.imageView18)
    ImageView imageView18;
    @BindView(R.id.imageView20)
    ImageView imageView20;
    @BindView(R.id.imageView19)
    ImageView imageView19;
    @BindView(R.id.imageView21)
    ImageView imageView21;
    @BindView(R.id.textView58)
    TextView textView58;
    @BindView(R.id.textView57)
    TextView textView57;
    @BindView(R.id.textView59)
    TextView textView59;
    @BindView(R.id.textView61)
    TextView textView61;
    @BindView(R.id.textView64)
    TextView textView64;
    @BindView(R.id.textView60)
    TextView textView60;
    @BindView(R.id.textView65)
    TextView textView65;
    @BindView(R.id.textView62)
    TextView textView62;
    @BindView(R.id.textView66)
    TextView textView66;
    @BindView(R.id.textView63)
    TextView textView63;
    @BindView(R.id.view19)
    View view19;

    @Override
    protected int getLayoutId() {
        return R.layout.fragment_mine;
    }

    @Override
    protected void initView(View view) {

        BaseObjectBean<UserInfo> userInfo = UserInfoUtils.getUserInfo();
        String username = userInfo.getData().getUser().getUsername();
        if (!TextUtils.isEmpty(username)) {
            tvNickName.setText(username);
        }
        String money = String.valueOf(userInfo.getData().getUser().getMoney());
        if (!TextUtils.isEmpty(money)) {
            tvTotalAssets.setText(money);
        }
    }

    @OnClick({R.id.imageView23, R.id.imageView24, R.id.imageView25, R.id.imageView26, R.id.textView63})
    public void onViewClicked(View view) {
        switch (view.getId()) {

            case R.id.imageView23:
                break;
            case R.id.imageView25:
                break;
            //玩法规则
            case R.id.imageView26:
            case R.id.textView63:
                Intent rulesOfPlayIntent = new Intent(getActivity(), RulesOfPlayActivity.class);
                startActivity(rulesOfPlayIntent);
                break;
            //提现充值记录
            case R.id.imageView24:
            case R.id.textView60:
                Intent withdrawAndRechargeIntent = new Intent(getActivity(), DepositAndWithdrawalRecordActivity.class);
                startActivity(withdrawAndRechargeIntent);
                break;
        }
    }
}
